﻿using Marmat.Common.Http;
using System;
using System.Collections.Generic;
using System.Text;

namespace Marmat.FrameWork
{
    public static class HttpApiConfigExtension
    {
        /// <summary>
        /// 启用jwt身份验证。
        /// </summary>
        /// <param name="config"></param>
        public static void AddJwtBearer(this HttpApiConfig config)
        {
            config.Filters.Add(new Common.Http.JwtBearer.JwtBearerFilterAttribute());
            config.Filters.Add(new Common.Http.JwtBearer.JwtBearerResultFilterAttribute());
        }

        /// <summary>
        /// 启用Token身份验证。
        /// </summary>
        /// <param name="config"></param>
        public static void AddToken(this HttpApiConfig config)
        {
            config.Filters.Add(new Common.Http.Token.TokenFilterAttribute());
            config.Filters.Add(new Common.Http.Token.TokenResultFilterAttribute());
        }
    }
}
